$('#cr_upload').click(function () {
    var img = document.getElementById('CR_content').files[0];
    var creator = document.getElementById('CR_creator').value;
    var owner = document.getElementById('CR_owner').value;
    var form_data = new FormData();
    
    form_data.append('name', img.name);
    form_data.append('img', img);
    form_data.append('owner', owner)
    form_data.append('creator', creator)

    $.ajax({
        type: 'POST',
        url: 'cr_upload',
        cache: false,
        processData: false,
        contentType: false,
        data: form_data,
        dataType: 'json'
    }).done(function (data) {
        console.log(data);
        alert(data.errMsg);
    }).fail(function (err) {
        console.error(err);
    }) 
})